class Solution {
public:
    int minCostClimbingStairs(vector<int>& cost) {
       int len = cost.size();
       vector<int> dp(len+1);
         dp[0] = 0;
         dp[1] = 0;
         int i = 0;
      for( i =2;i < dp.size();i++){
        dp[i] = min(dp[i-2]+cost[i-2],dp[i-1]+cost[i-1]);
      }
        return dp[dp.size()-1];
    }
};
